<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>管&nbsp;&nbsp;理&nbsp;&nbsp;系&nbsp;&nbsp;统</title>

<link rel="stylesheet" href="resources/css/bootstrap.min.css">
<link rel="stylesheet" href="resources/css/sidebar-menu.css">
<link rel="stylesheet" href="resources/css/font-awesome.css">
<link rel="stylesheet" href="resources/css/sweetalert2.css">
<style type="text/css">
body{
	overflow:-Scroll;
	overflow-x:hidden;
}
.main-sidebar{
	position: absolute;
	top: 50px;
	left: 0;
	height: 100%;
	min-height: 100%;
	width: 230px;
	z-index: 810;
	background-color: #222d32;
 }
 .navbar{
 	
 	width: 100%;
 	height: 50px;
 	background-color: #3c8dbc;
 	    border-radius: 0;
 }
 .navbarLeft{
 	float: left;
 	background-color: #367fa9;
 	width: 230px;
 	height: 100%;
 }
 .navbarLeft .logo-lg{
	display: block;
	color: #fff;
	font-size: 20px;
    line-height: 50px;
    text-align: center;
    font-weight: 300;
    font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;
 }
  .navbarLeft .logo-lg b{

  	font-weight: 800;
  }
  .navbar .navbar-custom-menu{
  position: relative;
  	float: right;
  }
  .navbarRight{
  	margin-left:1830px;width:100%;
  } 
  .navbar .navbar-custom-menu .navbar-nav .right{
  	color: #fff;	
  	    padding-top: 15px;
    padding-bottom: 15px;
    line-height: 20px;
    display: block;
    list-style-type: disc;
    -webkit-margin-before: 1em;
    -webkit-margin-after: 1em;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
    -webkit-padding-start: 40px;

  }
</style>

</head>
<body>
<nav class="navbar">
	<div class="navbarLeft"><span class="logo-lg">管&nbsp;&nbsp;理&nbsp;&nbsp;系&nbsp;&nbsp;统</span></div>
	<div class="navbarRight">	
		<i id="logOut" class="fa fa-sign-out fa-3x" style="height:40px;width:40px;cursor:pointer;margin-top:2px"></i>
	</div>
</nav>
<aside class="main-sidebar">
	<section id="div_menu" class="sidebar">
    </section>
</aside>
<div id="content" style="position: absolute;margin-left:230px;margin-top:-20px;height:100%;width:100%">
	<iframe id="menuFrame" name="menuFrame" src="" style="overflow:visible;" scrolling="no" frameborder="no" width="100%" height="100%; float:left">
	</iframe>
</div>

<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/sidebar-menu.js"></script>
<script src="resources/js/initTree.js"></script>
<script src="resources/js/sweetalert2.min.js"></script>
</body>

<script type="text/javascript">

$(document).ready(function () {
	//ajax后台获取数据
	$.post("./sys/userinfo", function(data) {
		
		var menuData = data.menuList;
		if(menuData!=null && menuData!='' ){
			initTree(menuData);
		}
	});
	
	$("li").on('click', function() {
        var href = $(this).find("a").attr('href');
        $('#content').empty();
        $('#content').load(href);
        //阻止跳转
        $(this).parents('li').addClass('active').siblings('li').removeClass('active');
        return false;
    });
	
	$("#logOut").on('click', function() {
		swal({ 
			  title: "退出？", 
			  text: "你即将退出系统！", 
			  type: "warning",
			  showCancelButton: true, 
			  confirmButtonColor: "#DD6B55",
			  confirmButtonText: "确定", 
			  cancelButtonText: "取消", 
			  closeOnConfirm: false
		}).then((result)=>{
			if(result){
				window.location.href="./logout";
			}
		});
	});
});

</script>

</html>